<?php namespace Home\Controller;
use Framework\Kernel\Controller;
use Home\Model\User;
class LoginController extends Controller{
	protected $db;
	public function __init()
	{
		$this->db = new User;
	}
	public function reg()
	{
		if(IS_POST)
		{
			if($this->db->reg()){
				$this->success('注册成功');
			}
			else
			{
				$this->error($this->db->getError());
			}
		}
		else
		{
			$this->display('reg.php');
		}
	}

	public function login()
	{

	}
	public function quit()
	{

	}
	public function code()
	{
		$code = new \Framework\Tool\Code;
		$code->show();
	}
}